/*
East Asian Welfare Regime Paper
Multi-Level Modeling
July 9, 2025
Minjin Choi
*/

* 1. Merged Data. ========================
clear all

use "/Users/jinny/Library/CloudStorage/OneDrive-UniversityofGeorgia/UGA/0_Dissertation/Ch1/test/wvs_merged_data_070825.dta", clear

gen AVR_GEN_num = real(AVR_GEN)
keep if immigrant == 1
generate  EA = inlist(cntry, 410, 392, 158)

* Multilevel Modeling

* simple model

* 모델 저장
eststo clear
eststo m1: mixed welfare_chauvinism age sex edu X028 id_lr national_pride AVR_GEN_num ///
    EA || COUNTRY_YEAR:

esttab m1 using "multilevel_cleaned_2.tex", ///
    se b(2) se(3) label ///
    style(tex) booktabs fragment nomtitle noomitted nogap nonotes ///
    compress brackets ///
    coeflabels( ///
        age "Age" ///
        sex "Female" ///
        edu "Education Level" ///
        X028 "Employment Instability" ///
        id_lr "Political Ideology" ///
        national_pride "National Pride" ///
        AVR_GEN_num "Average Generosity Index" ///
        EA "East Asian Country") ///
    keep(age sex edu X028 id_lr national_pride AVR_GEN_num EA) ///
    stats(N, labels("Observations"))


* 모델 저장
eststo clear
eststo m1: mixed welfare_chauvinism age sex edu X028 id_lr national_pride AVR_GEN_num ///
    c.EA##c.EA_welfare_score || COUNTRY_YEAR:

esttab m1 using "multilevel_cleaned_2.tex", ///
    se b(2) se(3) label ///
    style(tex) booktabs fragment nomtitle noomitted nogap nonotes ///
    compress brackets ///
    coeflabels( ///
        age "Age" ///
        sex "Female" ///
        edu "Education Level" ///
        X028 "Employment Instability" ///
        id_lr "Political Ideology" ///
        national_pride "National Pride" ///
        AVR_GEN_num "Average Generosity Index" ///
        EA "East Asian Country" ///
		EA_welfare_score "East Asian Welfare Regime Score" ///
		c.EA#c.EA_welfare_score "EA x EA Welfare Regime Score")
    keep(age sex edu X028 id_lr national_pride AVR_GEN_num EA EA_welfare_score c.EA#c.EA_welfare_score) ///
    stats(N, labels("Observations"))



